package com.coocaa.ops.plus.core.third.dmp.config;

import com.coocaa.ops.plus.core.third.dmp.DmpFeignClient;
import com.coocaa.ops.common.tool.feign.FeignUtil;
import feign.codec.Encoder;
import org.springframework.cloud.openfeign.FeignClientsConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * @author tangminghong
 * @date 2020-06-18
 */
@Configuration
@Import(FeignClientsConfiguration.class)
public class DmpFeignConfig {

    private static final int CONNECT_TIMEOUT_MILLIS = 12000;

    private static final int READ_TIMEOUT_MILLIS = 9000;

    @Bean
    public DmpFeignClient dmpFeignClient(Encoder encoder) {
        DmpFeignClient feignClient = FeignUtil.getFeignClient(encoder, DmpFeignClient.class, CONNECT_TIMEOUT_MILLIS, READ_TIMEOUT_MILLIS);
        return feignClient;
    }


}
